package com.yuanss.smart.framework.bean;

import com.yuanss.smart.framework.util.CastUtil;
import com.yuanss.smart.framework.util.CollectionUtil;

import java.util.Map;

/**
 * @Description 请求参数对象
 * @Date 2024/11/14 下午2:56
 * @Created by 菜到不敢run
 */
public class Param {

    private Map<String, Object> paramMap;

    public Param(Map<String, Object> paramMap) {
        this.paramMap = paramMap;
    }

    /**
     * 根据参数名获取long型参数值
     */
    public long getLong(String name){
        return CastUtil.castLong(paramMap.get(name));
    }

    //此处省略获取各个类型参数值的方法...

    /**
     * 获取所有字段信息
     */
    public Map<String, Object> getMap(){
        return paramMap;
    }

    @Override
    public String toString() {
        return "Param{" +
                "paramMap=" + paramMap +
                '}';
    }

    public boolean isEmpty(){
        return CollectionUtil.isEmpty(paramMap);
    }
}
